SELECT
<#assign prefixName=' '>
<#if (select__endDaTi??)>
${prefixName} T.END_DA_TI AS endDaTi
	<#assign prefixName=','>
</#if>
<#if (select__department5Id??)>
${prefixName} T.DEPARTMENT_5_ID AS department5Id
	<#assign prefixName=','>
</#if>
<#if (select__department3Id??)>
${prefixName} T.DEPARTMENT_3_ID AS department3Id
	<#assign prefixName=','>
</#if>
<#if (select__department6Id??)>
${prefixName} T.DEPARTMENT_6_ID AS department6Id
	<#assign prefixName=','>
</#if>
<#if (select__code??)>
${prefixName} T.CODE AS code
	<#assign prefixName=','>
</#if>
<#if (select__department2Id??)>
${prefixName} T.DEPARTMENT_2_ID AS department2Id
	<#assign prefixName=','>
</#if>
<#if (select__id??)>
${prefixName} T.ID AS id
	<#assign prefixName=','>
</#if>
<#if (select__email??)>
${prefixName} T.EMAIL AS email
	<#assign prefixName=','>
</#if>
<#if (select__name??)>
${prefixName} T.NAME AS name
	<#assign prefixName=','>
</#if>
<#if (select__beginDaTi??)>
${prefixName} T.BEGIN_DA_TI AS beginDaTi
	<#assign prefixName=','>
</#if>
<#if (select__department1Id??)>
${prefixName} T.DEPARTMENT_1_ID AS department1Id
	<#assign prefixName=','>
</#if>
<#if (select__departmentId??)>
${prefixName} T.DEPARTMENT_ID AS departmentId
	<#assign prefixName=','>
</#if>
<#if (select__sexCo??)>
${prefixName} T.SEX_CO AS sexCo
	<#assign prefixName=','>
</#if>
<#if (select__department4Id??)>
${prefixName} T.DEPARTMENT_4_ID AS department4Id
	<#assign prefixName=','>
</#if>
<#if prefixName == ' '>
  T.END_DA_TI AS endDaTi
, T.DEPARTMENT_5_ID AS department5Id
, T.DEPARTMENT_3_ID AS department3Id
, T.DEPARTMENT_6_ID AS department6Id
, T.CODE AS code
, T.DEPARTMENT_2_ID AS department2Id
, T.ID AS id
, T.EMAIL AS email
, T.NAME AS name
, T.BEGIN_DA_TI AS beginDaTi
, T.DEPARTMENT_1_ID AS department1Id
, T.DEPARTMENT_ID AS departmentId
, T.SEX_CO AS sexCo
, T.DEPARTMENT_4_ID AS department4Id
</#if>
FROM FD_USER T
<#include "whereUserBy1.ftl">
<#assign prefixName='ORDER BY'>
<#if (order__by__endDaTi??)>
${prefixName} T.END_DA_TI ${order__by__endDaTi__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__department5Id??)>
${prefixName} T.DEPARTMENT_5_ID ${order__by__department5Id__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__department3Id??)>
${prefixName} T.DEPARTMENT_3_ID ${order__by__department3Id__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__department6Id??)>
${prefixName} T.DEPARTMENT_6_ID ${order__by__department6Id__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__code??)>
${prefixName} T.CODE ${order__by__code__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__department2Id??)>
${prefixName} T.DEPARTMENT_2_ID ${order__by__department2Id__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__id??)>
${prefixName} T.ID ${order__by__id__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__email??)>
${prefixName} T.EMAIL ${order__by__email__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__name??)>
${prefixName} T.NAME ${order__by__name__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__beginDaTi??)>
${prefixName} T.BEGIN_DA_TI ${order__by__beginDaTi__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__department1Id??)>
${prefixName} T.DEPARTMENT_1_ID ${order__by__department1Id__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__departmentId??)>
${prefixName} T.DEPARTMENT_ID ${order__by__departmentId__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__sexCo??)>
${prefixName} T.SEX_CO ${order__by__sexCo__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__department4Id??)>
${prefixName} T.DEPARTMENT_4_ID ${order__by__department4Id__value!}
	<#assign prefixName=','>
</#if>
